package com.hailin.pigapi.controller.pigAuth;

import com.hailin.pigapi.common.Result;
import com.hailin.pigapi.request.auth.UserInfoRequest;
import com.hailin.pigapi.service.pigAuth.PigAuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "pig-auth")
public class PigAuthController {

    @Autowired
    private PigAuthService pigAuthService;

    @PostMapping("/login")
    public Result login(@ModelAttribute UserInfoRequest userInfoRequest){
        return pigAuthService.login(userInfoRequest);
    }
}
